package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.JieyongConfrimSLDTO;
import com.neusoft.neuiotms.dcam.workflow.model.JieyongConfrimSL;

@Component
public class JieyongConfrimSLConverter extends AbstractConverter<JieyongConfrimSL, JieyongConfrimSLDTO> {

    @Override
    public JieyongConfrimSL toModel(final JieyongConfrimSLDTO dto) {

        final JieyongConfrimSL model = new JieyongConfrimSL();

        model.setTaskId(dto.getTaskId());
        model.setWorkOrderNum(dto.getWorkOrderNum());
        model.setName(dto.getName());
        model.setCode(dto.getCode());
        model.setSerialnumber(dto.getSerialnumber());
        model.setSpecifications(dto.getSpecifications());
        model.setBigTypeName(dto.getBigTypeName());
        model.setBigTypeCode(dto.getBigTypeCode());
        model.setMiddleTypeName(dto.getMiddleTypeName());
        model.setMiddleTypeCode(dto.getMiddleTypeCode());
        model.setSmallTypeName(dto.getSmallTypeName());
        model.setSmallTypeCode(dto.getSmallTypeCode());
        model.setJieyongUserCode(dto.getJieyongUserCode());
        model.setJieyongUserName(dto.getJieyongUserName());
        model.setJieyongLocation(dto.getJieyongLocation());
        model.setJieyongLocationName(dto.getJieyongLocationName());
        model.setStatus(dto.getStatus());
        return model;
    }

    @Override
    public JieyongConfrimSLDTO toDTO(final JieyongConfrimSL model, final boolean forListView) {

        final JieyongConfrimSLDTO dto = new JieyongConfrimSLDTO();
        dto.setId(model.getId());
        dto.setTaskId(model.getTaskId());
        dto.setWorkOrderNum(model.getWorkOrderNum());
        dto.setName(model.getName());
        dto.setCode(model.getCode());
        dto.setSerialnumber(model.getSerialnumber());
        dto.setSpecifications(model.getSpecifications());
        dto.setBigTypeName(model.getBigTypeName());
        dto.setBigTypeCode(model.getBigTypeCode());
        dto.setMiddleTypeName(model.getMiddleTypeName());
        dto.setMiddleTypeCode(model.getMiddleTypeCode());
        dto.setSmallTypeName(model.getSmallTypeName());
        dto.setSmallTypeCode(model.getSmallTypeCode());
        dto.setJieyongUserCode(model.getJieyongUserCode());
        dto.setJieyongUserName(model.getJieyongUserName());
        dto.setJieyongLocation(model.getJieyongLocation());
        dto.setJieyongLocationName(model.getJieyongLocationName());
        dto.setStatus(model.getStatus());
        return dto;
    }

}
